package com.example.weatherforecast.base;

import android.util.Log;

import androidx.appcompat.app.AppCompatActivity;

import org.xutils.common.Callback;
import org.xutils.http.RequestParams;
import org.xutils.x;

/**
 * 封装查找activity的联网请求
 */
public class BaseActivity extends AppCompatActivity implements Callback.CommonCallback<String> {

    /**
     * 向地址url发送get请求
     * @param url 地址
     */
    public void loadData(String url) {
        RequestParams params = new RequestParams(url);
        x.http().get(params, this);
    }

    @Override
    public void onSuccess(String result) {

    }

    @Override
    public void onError(Throwable ex, boolean isOnCallback) {

    }

    @Override
    public void onCancelled(CancelledException cex) {

    }

    @Override
    public void onFinished() {

    }
}
